<%-- 
    Document   : viewEnrichNet
    Created on : 23-feb-2014, 16:58:46
    Author     : Juan
--%>

<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    /*Se obtiene la lista de valores retornada por el script de R*/
    List<List> listaEnrich = (List<List>) session.getAttribute("listaEnrich");
    String fgs = (String)session.getAttribute("fgs");
    String cabecera="";
    if(fgs.equals("KEGG")){
        cabecera= "Pathway";
    }
    else if(fgs.equals("Reactome")){
        cabecera= "Path";
    }

    /*Se pinta la tabla que será recogida mediante Out*/
    String ficPhp = "<table>"
            + "<thead>"
            + "<tr>"
            + "<th>"+cabecera+"</th>"
            + "<th>Number Links</th>"
            + "<th>Expected Links</th>"
            + "<th>Number of Genes</th>"
            + "<th>Number of AGS Genes</th>"
            + "<th>Z Score</th>"
            + "<th>P Value</th>"
            + "<th>FDR</th>"
            + "</tr>"
            + "</thead>";

    ficPhp += "<tbody>";
    for (int i = 0; i < listaEnrich.size(); i++) {
        List subList = listaEnrich.get(i);

        ficPhp += "<tr>";
        for (int j = 0; j < subList.size(); j++) {

            ficPhp += "<td>" + subList.get(j) + "</td>";

        }
        ficPhp += "</tr>";

    }
    ficPhp += "</tbody>";

    ficPhp += "</table>";

    out.append(ficPhp);

%>